package com.woniu.mealsService.consumer;

import com.woniu.mealsService.service.OrderProductService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author jiang
 */
@Component
@RabbitListener(queues = "error_order")
public class ErrorOrderConsumer {
    @Autowired
    private OrderProductService orderProductService;
    @RabbitHandler
    public void errorOrder(Map<String,String> map) throws Exception {
        orderProductService.saveErrorOrder(map);
    }
}
